package 文件内容操作;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:对于字节流 还可以使用Scanner来进行读取
 * User: lenovo
 * Date: 2022-10-16
 * Time: 20:45
 */
public class demo6 {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream("./bbb.txt");
        Scanner scanner = new Scanner(inputStream);//相当于是给inputStream套上了一层壳
        while(scanner.hasNext()){
            System.out.println(scanner.next());
        }
        inputStream.close();
    }
}
